<?php namespace Common\Model;
use Hdphp\Model\Model;
class TypeAttr extends Model{
	protected $table="type_attr";
	protected $validate=array(
		array('taname','required','属性名称不能为空',3,3),
		array('tavalue','required','属性值不能为空',3,3)
	);
	protected $auto=[
        ['type_tid','getTid','method',3,1]
    ];
	public function store(){
		if(!$this->create()) return false;
		$this->add();
		return true;
	}
	public function getTid(){
		$tid=Q('get.type_tid',0,'intval');
		return $tid;
	}
	public function edit(){
		if(!$this->create()) return false;
		p($this->data);
		$this->save();
		return true;
	}
	

}